﻿using System;
using System.Collections.Generic;
using System.Text;
using Tauren.Business.DLL.Base;
using Tauren.Business.Entity.Model;
using Tauren.Business.Entity.Output;

namespace Tauren.Business.DLL.RoleInfoDLL
{
    public interface IRoleInfoBusiness : IBaseDLL
    {
        /// <summary>
        /// 新增数据
        /// </summary>
        /// <param name="Model">数据体</param>
        /// <returns></returns>
        long Add(Roleinfo Model);

        /// <summary>
        /// 新增多语言
        /// </summary>
        /// <param name="res"></param>
        /// <returns></returns>
        bool Add(List<RoleRes> res);

        /// <summary>
        /// 新增角色中的人员
        /// </summary>
        /// <param name="PersonInfos"></param>
        /// <returns></returns>
        bool Add(List<RolePersonInfo> PersonInfos, long roleId);

        /// <summary>
        /// 给角色附件权限
        /// </summary>
        /// <param name="PersonInfos"></param>
        /// <returns></returns>
        bool Add(List<RolePermission> Permissions, long roleId);

        /// <summary>
        /// 编辑角色
        /// </summary>
        /// <param name="Model"></param>
        /// <returns></returns>
        bool Edit(Roleinfo Model);

        /// <summary>
        /// 判断角色编码是否重复
        /// </summary>
        /// <param name="AutoId"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        bool IsCodeRepeat(long AutoId, string Code);


        /// <summary>
        /// 获取序号
        /// </summary>
        /// <returns></returns>
        double GetSeq();

        /// <summary>
        /// 获取单个数据
        /// </summary>
        /// <param name="AutoId"></param>
        /// <returns></returns>
        Roleinfo FirstDefault(long AutoId);

        /// <summary>
        /// 获取单个数据带多语言
        /// </summary>
        /// <param name="AutoId"></param>
        /// <returns></returns>
        List<RoleInfoTable> Get(long AutoId);

        /// <summary>
        /// 获取当前角色的所有权限
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        List<RolePermission_OutPut> GetRolePermissions(long RoleId);

        /// <summary>
        /// 获取角色对应的人员
        /// </summary>
        /// <param name="RoleId"></param>
        /// <returns></returns>
        List<RolePersonInfo_OutPut> GetRolePersonInfos(long RoleId);

        /// <summary>
        /// 分页获取角色信息
        /// </summary>
        /// <param name="queryModel"></param>
        /// <param name="Total"></param>
        /// <returns></returns>
        List<PageRoleInfoTable> Pages(Entity.Global.QueryModel queryModel, out long Total);
    }
}
